x=('[]')
och=[]
openn=['(','[','{','<']
close=[')',']','}','>']
def f(a):
    ohc=[]
    for i in range(len(a)):
        if a[i] in openn:
                   och.append(openn.index(a[i]))
        elif a[i] in close:
            if len(och)==0:
                return False
            elif close.index(a[i]) ==1:
                return True
            else:
                return True
    if len(och) != 0:
        return False
    return True
print(f(x))
